#include <iostream>
int main()
{
    std::string s1 = "123a";
    // size_t *p1 = (size_t *)&s1[0];
    size_t *p1 = (size_t *)&(*s1.begin());

    int x = std::stoi(s1, p1, 16);
    if (*p1 == s1.length())
    {
        std::cout << "str_to_num success" << std::endl;
        std::cout << "x = " << x << std::endl;
    }
    else
    {
        std::cout << "str_to_num failed" << std::endl;
        std::cout << "x = " << x << std::endl;
    }

    return 0;
}